package com.xyf.sys.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
public class Dept {
    private Long deptId;

    private Long parentId;

    private String ancestors;

    private String deptName;

    private String shopAnnouncement;

    private String avatar;

    private String leader;

    private String mobile;

    private String address;

    private String locationName;

    private String code;

    private String country;

    private String province;

    private String city;

    private String area;

    private BigDecimal longitude;

    private BigDecimal latitude;

    private String realId;

    private String realName;

    private Long logisticPriceSchemeId;

    private Long dryCleaningPriceSchemeId;

    private BigDecimal pickUpPrice;

    private String supplierTypeDictIds;

    private String email;

    private Integer mainDept;

    private Integer orderNum;

    private String status;

    private String delFlag;

    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private BigDecimal distance;

    private String userId;

    private List<Dept> children = new ArrayList<>();

    private List<User> users = new ArrayList<>();

    private List<UserPrinter> printers;

    private List<UserLogistic> logistics;

    private PriceScheme logisticPriceScheme;

    private PriceScheme dryCleaningPriceScheme;

    private List<DictData> supplierTypeList;

    private Dept parentDeptInfo;

    private List<Role> roles;

    public List<Long> roles_;

    public List<Long> logistics_;

    public BigDecimal getDistance() {
        return distance == null ? null : distance.setScale(2, RoundingMode.HALF_UP);
    }

    private String name;

    private List<Goods> products;
}